import { service } from "@/utils/request";

//封装的请求函数，应该将响应返回出去，而不是相应的数据
export async function post(url, data, params = {}) {
  try {
    return await service.post(url, data, { params });
  } catch (e) {
    throw new Error(e);
  }
}

export async function get(url, params = {}) {
  try {
    return await service.get(url, { params });
  } catch (e) {
    throw new Error(e);
  }
}
